// Event Throttle
var timer=false;
function action(){
	if(timer){
		return;
	}
	console.log('hello');
	timer=setTimeout(()=>timer=null,500);
}

// Event Agent
var tag=document.getElementById('id');
var parent=tag.parentElement;
parent.addEventListener('click',action); //tag.onclick='action()'

//Event debounce
var clock=false;
function action2(){
	clearTimeout(clock);
	clock=setTimeout(()=>console.log('hello'),500);
}
